<?php

/**
 * Clase Model
 *
 * @version $Id$
 * @copyright 2006
 */
class Model
{
	var $instance  = null;
	var $DBManager = null;

	function &getInstance()
	{
		static $model;
		if(!$model)
		{
			$class = get_class($this);
			$model = new $class;
		}
		return $model;
	}

	function getDBManager($name = "")
	{
		$var_name = empty($name) ? 'db' : 'db_' . $name;
		if ($this->DBManager == null)
		{
			$this->DBManager = new DBManager();
		}
		return $this->DBManager->getInstance($name);
	}
}

?>